package de.mhu.mandalaui.actions;

import java.io.PrintWriter;

import de.mhu.mandalaui.attributes.ArrayAttribute;

public class CleanArrayAttributeAction extends Action {

	private ArrayAttribute target;
	
	public CleanArrayAttributeAction() {}
	
	public CleanArrayAttributeAction(ArrayAttribute target) {
		setTarget(target);
	}
	
	@Override
	public void renderFunctionImplementation(PrintWriter out) {
		out.println("function() {");
		if (target != null) {
			target.renderRemoveAll(out);
		}
		out.println("}");
	}

	public ArrayAttribute getTarget() {
		return target;
	}

	public void setTarget(ArrayAttribute target) {
		this.target = target;
	}

}
